< previous page page_427 next page >

Page 427
Private Sub Form_Resize()
    'A FORM'S (0,0) COORDINATES
    'ARE IN ITS UPPER-LEFT CORNER

    Line1.Y1 = Form1.ScaleHeight / 2
    Line1.X1 = 0

    Line1.X2 = Form1.ScaleWidth
    Line1.Y2 = Line1.Y1

End Sub
The code in the Resize event adjusts the size and position of the line so that it remains a horizontal line in the center of the form. By default, a Line control creates a solid line, but you can create dashed or other line styles by setting the BorderStyle property. Figure 19.1 shows several Line controls drawn on a form using the various styles and the BorderStyle property options for the Line control.
0427-01.jpg
Figure 19.1
The Line control enables you to
place lines of various styles on a form.
note.gif The BorderStyle property does not have any effect when the BorderWidth property is greater than one. square.gif

The Shape control provides another simple means of placing graphics elements on a form. You can use the Shape control to create any of the six shapes shown in Figure 19.2. As with the Line control, the BorderStyle property can be used to change the style of the line used to draw a shape.
0427-02.jpg
Figure 19.2
 You can change the Shape property of the Shape
control to create any of the shapes pictured.

 
< previous page page_427 next page >